<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPHinXsys: SPHINXsys/src/shared/simbody_sphinxsys/xml_engine.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SPHinXsys
   &#160;<span id="projectnumber">alpha version</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_3dc1dabd28ba78e072d14d3fcfc90454.html">SPHINXsys</a></li><li class="navelem"><a class="el" href="dir_48ea983704c43b6d88c1fa3f4d09e369.html">src</a></li><li class="navelem"><a class="el" href="dir_0a0d9ef1793521534f0094f317758287.html">shared</a></li><li class="navelem"><a class="el" href="dir_d6e4e2c6d31a1ca50e84d7953691b059.html">simbody_sphinxsys</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">xml_engine.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="xml__engine_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* -------------------------------------------------------------------------*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *                              SPHinXsys                                   *</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * --------------------------------------------------------------------------*</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * SPHinXsys (pronunciation: s&#39;finksis) is an acronym from Smoothed Particle    *</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Hydrodynamics for industrial compleX systems. It provides C++ APIs for   *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * physical accurate simulation and aims to model coupled industrial dynamic *</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * systems including fluid, solid, multi-body dynamics and beyond with SPH  *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * (smoothed particle hydrodynamics), a meshless computational method using *</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * particle discretization.                                                 *</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *                                                                          *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * SPHinXsys is partially funded by German Research Foundation              *</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * (Deutsche Forschungsgemeinschaft) DFG HU1527/6-1, HU1527/10-1                *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * and HU1527/12-1.                                                         *</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *                                                                           *</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * Portions copyright (c) 2017-2020 Technical University of Munich and      *</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * the authors&#39; affiliations.                                               *</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *                                                                           *</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may   *</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * not use this file except in compliance with the License. You may obtain a *</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.        *</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *                                                                           *</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * --------------------------------------------------------------------------*/</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#ifndef XML_ENGINE_SIMBODY_H</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#define XML_ENGINE_SIMBODY_H</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;base_data_package.h&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sph__data__containers_8h.html">sph_data_containers.h</a>&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;SimTKcommon.h&quot;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;SimTKcommon/internal/Xml.h&quot;</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;SimTKcommon/internal/String.h&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#ifdef __APPLE__</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;boost/filesystem.hpp&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">namespace </span>fs = boost::filesystem;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &lt;experimental/filesystem&gt;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keyword">namespace </span>fs = std::experimental::filesystem;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_s_p_h.html">SPH</a></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;{</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_engine.html">   56</a></span>&#160;    <span class="keyword">class </span><a class="code" href="class_s_p_h_1_1_xml_engine.html">XmlEngine</a></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    {</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keyword">protected</span>:</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_engine.html#a3dcafb84d4043f5e91089a82bc6a50d3">   59</a></span>&#160;        std::string <a class="code" href="class_s_p_h_1_1_xml_engine.html#a3dcafb84d4043f5e91089a82bc6a50d3">xml_name_</a>;        </div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_engine.html#a460fcf8901548235dd58b1b7dc58e445">   60</a></span>&#160;        SimTK::Xml::Document <a class="code" href="class_s_p_h_1_1_xml_engine.html#a460fcf8901548235dd58b1b7dc58e445">xmldoc_</a>; </div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <a class="code" href="class_s_p_h_1_1_xml_engine.html#a96589c0327d1affd27702d2b3bac2537">XmlEngine</a>(<span class="keyword">const</span> std::string &amp;xml_name, <span class="keyword">const</span> std::string &amp;root_tag);</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_engine.html#a89a8715da1700c2017496bb32d272833">   66</a></span>&#160;        <span class="keyword">virtual</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#a89a8715da1700c2017496bb32d272833">~XmlEngine</a>(){};</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        SimTK::Xml::Element <a class="code" href="class_s_p_h_1_1_xml_engine.html#ae7d5abfca7c289fcee482634b9e94b31">root_element_</a>; </div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#acbfd6f25b457eb50ec8d124d030e658d">addElementToXmlDoc</a>(<span class="keyword">const</span> std::string &amp;element_name);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#ad8dceb96c6e527b443034227d37fdff4">addChildToElement</a>(SimTK::Xml::Element &amp;father_element, <span class="keyword">const</span> std::string &amp;child_name);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;</div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_engine.html#af5887ebc47b3e40fba58ee6e07444590">   78</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#af5887ebc47b3e40fba58ee6e07444590">setAttributeToElement</a>(<span class="keyword">const</span> SimTK::Xml::element_iterator &amp;ele_ite, <span class="keyword">const</span> std::string &amp;attrib_name, <span class="keyword">const</span> T &amp;value)</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        {</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            SimTK::Xml::Attribute attr_(attrib_name, SimTK::String(value));</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            ele_ite-&gt;setAttributeValue(attr_.getName(), attr_.getValue());</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        };</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#af5887ebc47b3e40fba58ee6e07444590">setAttributeToElement</a>(<span class="keyword">const</span> SimTK::Xml::element_iterator &amp;ele_ite, <span class="keyword">const</span> std::string &amp;attrib_name, <span class="keyword">const</span> Matd &amp;value);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;</div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_engine.html#ae768b4bed069caf389ab94af9e6ca7e6">   88</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#ae768b4bed069caf389ab94af9e6ca7e6">getRequiredAttributeValue</a>(SimTK::Xml::element_iterator &amp;ele_ite_, <span class="keyword">const</span> std::string &amp;attrib_name, T &amp;value)</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        {</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            std::string value_in_string = ele_ite_-&gt;getRequiredAttributeValue(attrib_name);</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            value = SimTK::convertStringTo&lt;T&gt;(value_in_string);</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        };</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#ae31707330886443f8001f11b758248b8">getRequiredAttributeMatrixValue</a>(SimTK::Xml::element_iterator &amp;ele_ite_, <span class="keyword">const</span> std::string &amp;attrib_name, Matd &amp;value);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#a120172f71121f628394532b3bbd429c7">writeToXmlFile</a>(<span class="keyword">const</span> std::string &amp;filefullpath);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#aa1b6caf41c78946a966dad952a2e326e">loadXmlFile</a>(<span class="keyword">const</span> std::string &amp;filefullpath);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        std::string <a class="code" href="class_s_p_h_1_1_xml_engine.html#a3545d16af502cd2d81f9596c1c82e45b">getRootElementTag</a>();</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        std::string <a class="code" href="class_s_p_h_1_1_xml_engine.html#acafab9f16378b853b3bee511baf3c1d5">getElementTag</a>(SimTK::Xml::Element &amp;element);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#a0907e04fe6d796cd5db3fbd72ce38b36">resizeXmlDocForParticles</a>(<span class="keywordtype">size_t</span> input_size);</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordtype">size_t</span> <a class="code" href="class_s_p_h_1_1_xml_engine.html#ae534e2595980de942c34f45e8698f5db">SizeOfXmlDoc</a>();</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        SimTK::Xml::Element <a class="code" href="class_s_p_h_1_1_xml_engine.html#a606aaea244b757012949d1e77a184258">getChildElement</a>(<span class="keyword">const</span> std::string &amp;tag);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    };</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_xml_memory_i_o.html">  116</a></span>&#160;    <span class="keyword">class </span><a class="code" href="class_s_p_h_1_1_xml_memory_i_o.html">XmlMemoryIO</a></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    {</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <a class="code" href="class_s_p_h_1_1_xml_memory_i_o.html">XmlMemoryIO</a>(){};</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keyword">virtual</span> ~<a class="code" href="class_s_p_h_1_1_xml_memory_i_o.html">XmlMemoryIO</a>(){};</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        <span class="keywordtype">void</span> writeDataToXmlMemory(<a class="code" href="class_s_p_h_1_1_xml_engine.html">XmlEngine</a> &amp;xml_engine, SimTK::Xml::Element &amp;element, <span class="keyword">const</span> DoubleVec&lt;T&gt; &amp;quantity,</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                                  <span class="keywordtype">int</span> snapshot_, <span class="keywordtype">int</span> observation_, <span class="keyword">const</span> std::string &amp;quantity_name, <a class="code" href="class_std_vec_3_01std_1_1string_01_4.html">StdVec&lt;std::string&gt;</a> &amp;element_tag)</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        {</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">int</span> snapshot_index = 0; snapshot_index != snapshot_; ++snapshot_index)</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            {</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                std::string element_name = element_tag[snapshot_index];</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                xml_engine.<a class="code" href="class_s_p_h_1_1_xml_engine.html#ad8dceb96c6e527b443034227d37fdff4">addChildToElement</a>(element, element_name);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                <span class="keywordflow">for</span> (<span class="keywordtype">int</span> observation_index = 0; observation_index != observation_; ++observation_index)</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                {</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                    SimTK::Xml::element_iterator ele_ite = element.element_begin(element_name);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                    std::string attribute_name_ = quantity_name + <span class="stringliteral">&quot;_&quot;</span> + std::to_string(observation_index);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                    xml_engine.<a class="code" href="class_s_p_h_1_1_xml_engine.html#af5887ebc47b3e40fba58ee6e07444590">setAttributeToElement</a>(ele_ite, attribute_name_, quantity[snapshot_index][observation_index]);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                }</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            }</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;        };</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordtype">void</span> writeDataToXmlMemory(<a class="code" href="class_s_p_h_1_1_xml_engine.html">XmlEngine</a> &amp;xml_engine, SimTK::Xml::Element &amp;element,</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                                  std::string element_name, <span class="keywordtype">int</span> observation_index, <span class="keyword">const</span> T &amp;quantity, <span class="keyword">const</span> std::string &amp;quantity_name)</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        {</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            SimTK::Xml::element_iterator ele_ite = element.element_begin(element_name);</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            std::string attribute_name_ = quantity_name + <span class="stringliteral">&quot;_&quot;</span> + std::to_string(observation_index);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            xml_engine.<a class="code" href="class_s_p_h_1_1_xml_engine.html#af5887ebc47b3e40fba58ee6e07444590">setAttributeToElement</a>(ele_ite, attribute_name_, quantity);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        };</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        <span class="keywordtype">void</span> readDataFromXmlMemory(<a class="code" href="class_s_p_h_1_1_xml_engine.html">XmlEngine</a> &amp;xml_engine, SimTK::Xml::Element &amp;element,</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;                                   <span class="keywordtype">int</span> observation_index, DoubleVec&lt;T&gt; &amp;result_container, <span class="keyword">const</span> std::string &amp;quantity_name)</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        {</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;            <span class="keywordtype">int</span> snapshot_index = 0;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;            SimTK::Xml::element_iterator ele_ite = element.element_begin();</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;            <span class="keywordflow">for</span> (; ele_ite != element.element_end(); ++ele_ite)</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            {</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                std::string attribute_name_ = quantity_name + <span class="stringliteral">&quot;_&quot;</span> + std::to_string(observation_index);</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;                xml_engine.<a class="code" href="class_s_p_h_1_1_xml_engine.html#ae768b4bed069caf389ab94af9e6ca7e6">getRequiredAttributeValue</a>&lt;T&gt;(ele_ite, attribute_name_, result_container[snapshot_index][observation_index]);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                snapshot_index++;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;            }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        };</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="keywordtype">void</span> readDataFromXmlMemory(<a class="code" href="class_s_p_h_1_1_xml_engine.html">XmlEngine</a> &amp;xml_engine, SimTK::Xml::Element &amp;element,</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;                                   <span class="keywordtype">size_t</span> observation_index, DoubleVec&lt;Matd&gt; &amp;result_container, <span class="keyword">const</span> std::string &amp;quantity_name);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        <span class="keywordtype">void</span> readTagFromXmlMemory(SimTK::Xml::Element &amp;element, <a class="code" href="class_std_vec_3_01std_1_1string_01_4.html">StdVec&lt;std::string&gt;</a> &amp;element_tag);</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    };</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;}</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="preprocessor">#endif // XML_ENGINE_SIMBODY_H</span></div><div class="ttc" id="class_s_p_h_1_1_xml_memory_i_o_html"><div class="ttname"><a href="class_s_p_h_1_1_xml_memory_i_o.html">SPH::XmlMemoryIO</a></div><div class="ttdef"><b>Definition:</b> xml_engine.h:116</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_aa1b6caf41c78946a966dad952a2e326e"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#aa1b6caf41c78946a966dad952a2e326e">SPH::XmlEngine::loadXmlFile</a></div><div class="ttdeci">void loadXmlFile(const std::string &amp;filefullpath)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:72</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_ae768b4bed069caf389ab94af9e6ca7e6"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#ae768b4bed069caf389ab94af9e6ca7e6">SPH::XmlEngine::getRequiredAttributeValue</a></div><div class="ttdeci">void getRequiredAttributeValue(SimTK::Xml::element_iterator &amp;ele_ite_, const std::string &amp;attrib_name, T &amp;value)</div><div class="ttdef"><b>Definition:</b> xml_engine.h:88</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a460fcf8901548235dd58b1b7dc58e445"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a460fcf8901548235dd58b1b7dc58e445">SPH::XmlEngine::xmldoc_</a></div><div class="ttdeci">SimTK::Xml::Document xmldoc_</div><div class="ttdef"><b>Definition:</b> xml_engine.h:60</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a96589c0327d1affd27702d2b3bac2537"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a96589c0327d1affd27702d2b3bac2537">SPH::XmlEngine::XmlEngine</a></div><div class="ttdeci">XmlEngine(const std::string &amp;xml_name, const std::string &amp;root_tag)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:12</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_ae7d5abfca7c289fcee482634b9e94b31"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#ae7d5abfca7c289fcee482634b9e94b31">SPH::XmlEngine::root_element_</a></div><div class="ttdeci">SimTK::Xml::Element root_element_</div><div class="ttdef"><b>Definition:</b> xml_engine.h:66</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a89a8715da1700c2017496bb32d272833"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a89a8715da1700c2017496bb32d272833">SPH::XmlEngine::~XmlEngine</a></div><div class="ttdeci">virtual ~XmlEngine()</div><div class="ttdef"><b>Definition:</b> xml_engine.h:66</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a3dcafb84d4043f5e91089a82bc6a50d3"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a3dcafb84d4043f5e91089a82bc6a50d3">SPH::XmlEngine::xml_name_</a></div><div class="ttdeci">std::string xml_name_</div><div class="ttdef"><b>Definition:</b> xml_engine.h:59</div></div>
<div class="ttc" id="class_std_vec_3_01std_1_1string_01_4_html"><div class="ttname"><a href="class_std_vec_3_01std_1_1string_01_4.html">StdVec&lt; std::string &gt;</a></div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_ad8dceb96c6e527b443034227d37fdff4"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#ad8dceb96c6e527b443034227d37fdff4">SPH::XmlEngine::addChildToElement</a></div><div class="ttdeci">void addChildToElement(SimTK::Xml::Element &amp;father_element, const std::string &amp;child_name)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:23</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_acbfd6f25b457eb50ec8d124d030e658d"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#acbfd6f25b457eb50ec8d124d030e658d">SPH::XmlEngine::addElementToXmlDoc</a></div><div class="ttdeci">void addElementToXmlDoc(const std::string &amp;element_name)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:18</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_ae534e2595980de942c34f45e8698f5db"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#ae534e2595980de942c34f45e8698f5db">SPH::XmlEngine::SizeOfXmlDoc</a></div><div class="ttdeci">size_t SizeOfXmlDoc()</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:106</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_af5887ebc47b3e40fba58ee6e07444590"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#af5887ebc47b3e40fba58ee6e07444590">SPH::XmlEngine::setAttributeToElement</a></div><div class="ttdeci">void setAttributeToElement(const SimTK::Xml::element_iterator &amp;ele_ite, const std::string &amp;attrib_name, const T &amp;value)</div><div class="ttdef"><b>Definition:</b> xml_engine.h:78</div></div>
<div class="ttc" id="sph__data__containers_8h_html"><div class="ttname"><a href="sph__data__containers_8h.html">sph_data_containers.h</a></div><div class="ttdoc">Set up of basic data structure. </div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a0907e04fe6d796cd5db3fbd72ce38b36"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a0907e04fe6d796cd5db3fbd72ce38b36">SPH::XmlEngine::resizeXmlDocForParticles</a></div><div class="ttdeci">void resizeXmlDocForParticles(size_t input_size)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:88</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_ae31707330886443f8001f11b758248b8"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#ae31707330886443f8001f11b758248b8">SPH::XmlEngine::getRequiredAttributeMatrixValue</a></div><div class="ttdeci">void getRequiredAttributeMatrixValue(SimTK::Xml::element_iterator &amp;ele_ite_, const std::string &amp;attrib_name, Matd &amp;value)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:41</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a120172f71121f628394532b3bbd429c7"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a120172f71121f628394532b3bbd429c7">SPH::XmlEngine::writeToXmlFile</a></div><div class="ttdeci">void writeToXmlFile(const std::string &amp;filefullpath)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:67</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a3545d16af502cd2d81f9596c1c82e45b"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a3545d16af502cd2d81f9596c1c82e45b">SPH::XmlEngine::getRootElementTag</a></div><div class="ttdeci">std::string getRootElementTag()</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:78</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html">SPH::XmlEngine</a></div><div class="ttdef"><b>Definition:</b> xml_engine.h:56</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_a606aaea244b757012949d1e77a184258"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#a606aaea244b757012949d1e77a184258">SPH::XmlEngine::getChildElement</a></div><div class="ttdeci">SimTK::Xml::Element getChildElement(const std::string &amp;tag)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:111</div></div>
<div class="ttc" id="class_s_p_h_1_1_xml_engine_html_acafab9f16378b853b3bee511baf3c1d5"><div class="ttname"><a href="class_s_p_h_1_1_xml_engine.html#acafab9f16378b853b3bee511baf3c1d5">SPH::XmlEngine::getElementTag</a></div><div class="ttdeci">std::string getElementTag(SimTK::Xml::Element &amp;element)</div><div class="ttdef"><b>Definition:</b> xml_engine.cpp:83</div></div>
<div class="ttc" id="namespace_s_p_h_html"><div class="ttname"><a href="namespace_s_p_h.html">SPH</a></div><div class="ttdef"><b>Definition:</b> solid_body_supplementary.cpp:9</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
